package sctu.edu.java.year2016.team01.xuhanmei.day20160611;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * Created by Administrator on 2016/6/12..
 */
public class TCPClient {
    public static void main(String[] args) throws IOException {
        Socket s=new Socket("127.0.0.1",6666);//ip地址和端口号
        OutputStream os=s.getOutputStream();//输出流
        DataOutputStream dos=new DataOutputStream(os);
        dos.writeUTF("同志们好");
        dos.flush();//刷新
        dos.close();//关闭流
    }
}
